<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
    	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>商品分类列表</title>
		<link href="${pageContext.request.contextPath }/css/bootstrap.min.css" rel="stylesheet">
		<script type="text/javascript">
			function add(){
				window.location.href="${pageContext.request.contextPath }/adminCategory_add.action";
			}
			function del(cid){
				if(confirm("确认要删除？")){
					window.location.href="${pageContext.request.contextPath }/adminCategory_delete.action?cid="+cid;
				}
			}
		</script>
	</head>
	<body>
		<div class="row">
			<div class="col-md-12">
				<div class="panel panel-default">
					<div class="panel-heading">商品分类列表</div>
					<div class="panel-body">
						<button class="btn btn-default" style="margin-bottom: 10px;" onclick="add()">添加商品分类</button>
						<table class="table table-striped table-hover table-bordered">
							<thead>
								<tr>
									<th>#</th>
									<th>分类名称</th>
									<td>编辑</td>
									<td>删除</td>
								</tr>
							</thead>
							<tbody>
								<s:iterator var="c" value="cList" status="st">
								<tr>
									<td><s:property value="#st.count"/></td>
									<td><s:property value="#c.cname"/></td>
									<td>
										<a href="${pageContext.request.contextPath }/adminCategory_edit.action?cid=<s:property value="#c.cid"/>"><span class="glyphicon glyphicon-pencil"></span></a>
									</td>
									<td>
										<a href="javascript:del(<s:property value="#c.cid"/>)"><span class="glyphicon glyphicon-remove"></span></a>
									</td>
								</tr>
								</s:iterator>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>

